﻿
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class D_Teacher
    {

        public bool Login_sugar(Model.Teacher m_teacher)
        {

            var teachers = Sugar_helper.Db.Queryable<Teacher>().Where(t => t.teacher_uname == m_teacher.teacher_uname && t.pwd == m_teacher.pwd).ToList();
            if (teachers.Count == 0)
                return false;
            log_info.teacher = teachers[0];
            return true;
        }

        public List<Teacher> GetList()
        {
            var list = Sugar_helper.Db.Queryable<Teacher>().ToList();
            return list;
        }
    }
}
